<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>WIKINDX CLASS DOCUMENTATION</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="/wikindx2/docs/docs.css" type="text/css" />
</head>

<body bgcolor="#FFFFFF" text="#000000">
<h2>WIKINDX METHODS</h2>
<p><strong>Method:</strong><br />
  
  formatAlias()
</p>
<p><strong>Class:</strong><br />

  <a href="sqlClass.html">SQL</a>
<p><strong>Method Call:</strong><br />
  include_once("core/sql/SQL.php");<br />
$db = new SQL();<br />
STRING $db->formatAlias(ASSOC_ARRAY: $array); </p>
<p><strong>Description:</strong><br />
  Format an associative array as a SQL alias clause.</p>
<p>  <a href="insertMethod.html">insert()</a>, <a href="selectMethod.html">select()</a> and <a href="selectnoexecuteMethod.html">selectNoExecute()</a> will automatically call this method if necessary. </p>
<p><strong>Usage:</strong><br />
  For example (assuming the database object exists within a class as $this->db):

<pre>
	$tables = array(array("WKX_resource" => "res"), "WKX_collection");
	$fields = array(array("WKX_resource.title" => "resT"), array("WKX_collection.title" => "collT"));
	$condition = "WHERE " . $this->db->formatField('id')  . "=" . $this->db->tidyInput(666);
	$recordset = $this->db->select($tables, $fields, $condition);</pre>
 The SQL statement  executed would be:
<pre>
	"SELECT `WKX_resource`.`title` AS `resT`, `WKX_collection`.`title` AS `collT` FROM `WKX_resource` AS `res`, `WKX_collection` WHERE `id`='666'"
</pre>
</p>
</p>
<p align="right"><a href="../../index.html">WIKINDX home</a>
&nbsp;&nbsp;&nbsp;&nbsp;
<a href="../../usage/index.html">WIKINDX usage</a>
&nbsp;&nbsp;&nbsp;&nbsp;
<a href="../index.html">WIKINDX classes</a>
</p>
</body>

</html>
